﻿@{
    ViewBag.Title = "Hồ sơ sinh viên";
    Layout = "~/Views/Shared/_Layout.cshtml";

    StudentPortal.STU_HoSoSinhVien sinhvien = ViewBag.SinhVien as StudentPortal.STU_HoSoSinhVien;
}
<form class="form-horizontal" id="frmHoSo">
    <div class="portlet box red">
        <div class="portlet-title">
            <h4>
                <i class="icon-reorder"></i>
                <span>Hồ sơ sinh viên</span>
            </h4>
        </div>
        <div class="portlet-body form">
            <div class="tabbable tabbable-custom">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab_1_1" data-toggle="tab">Thông tin cá nhân</a></li>
                    <li><a href="#tab_1_2" data-toggle="tab">Thông tin gia đình</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab_1_1">
                        <div class="row-fluid">
                            <div class="span6">
                                <div class="portlet box red">
                                    <div class="portlet-title">
                                        <h4>
                                            <i class="icon-reorder"></i>
                                            <span>Thông tin cá nhân</span>
                                        </h4>
                                    </div>
                                    <div class="portlet-body form">

                                        <div class="control-group">
                                            <label class="control-label">Mã sinh viên</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ma_sv" readonly="true" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Họ tên</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ho_ten" readonly="true"  />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Email</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Email" name="Email" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Ngày sinh</label>
                                            <div class="controls">
                                                @(Html.Kendo().DateTimePicker()
                                                    .Name("Ngay_sinh")
                                                    .Format("dd/MM/yyyy")
                                                    .Enable(false)
                                                    .Value(@sinhvien.Ngay_sinh).HtmlAttributes(new { name="Ngay_sinh"})
                                                )
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="span6">
                                <div class="portlet box red">
                                    <div class="portlet-title">
                                        <h4>
                                            <i class="icon-reorder"></i>
                                            <span>Thông tin liên lạc</span>
                                        </h4>
                                    </div>
                                    <div class="portlet-body form">

                                        <div class="control-group">
                                            <label class="control-label">Điện thoại nhà riêng</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Dien_thoai_NR" name="Dien_thoai_NR" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Điện thoại cá nhân</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Dienthoai_canhan" name="Dienthoai_canhan" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Nơi ở hiện nay</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.NoiO_hiennay" name="NoiO_hiennay" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Địa chỉ báo tin</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Dia_chi_bao_tin" name="Dia_chi_bao_tin" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span6">
                                <div class="portlet box red">
                                    <div class="portlet-title">
                                        <h4>
                                            <i class="icon-reorder"></i>
                                            <span>Thông tin cơ bản</span>
                                        </h4>
                                    </div>
                                    <div class="portlet-body form">
                                        <div class="control-group">
                                            <label class="control-label">Quốc tịch</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_quoc_tich" name="ID_quoc_tich" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_quoc_tich")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name="ID_quoc_tich" })
                                                    .Value(sinhvien.ID_quoc_tich.ToString())
                                                    .BindTo(ViewBag.QuocTich)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Dân tộc</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_dan_toc" name="ID_dan_toc" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_dan_toc")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name="ID_dan_toc" })
                                                    .Value(sinhvien.ID_dan_toc.ToString())
                                                    .BindTo(ViewBag.DanToc)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Tôn giáo</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ton_giao" name="Ton_giao" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Số CMND</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.CMND" name="CMND" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Ngày cấp</label>
                                            <div class="controls">
                                                @(Html.Kendo().DateTimePicker()
                                                    .Name("Ngay_cap")
                                                    .Format("dd/MM/yyyy")
                                                    .Value(@sinhvien.Ngay_cap)
                                                    .HtmlAttributes(new { name="Ngay_cap"})
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Nơi cấp</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Noi_cap" name="Noi_cap" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Ngày vào Đoàn</label>
                                            <div class="controls">
                                                @(Html.Kendo().DateTimePicker()
                                                    .Name("Ngay_vao_doan")
                                                    .Format("dd/MM/yyyy")
                                                    .Value(@sinhvien.Ngay_vao_doan)
                                                    .HtmlAttributes(new { name="Ngay_vao_doan"})
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Ngày vào Đảng</label>
                                            <div class="controls">
                                                @(Html.Kendo().DateTimePicker()
                                                    .Name("Ngay_vao_dang")
                                                    .Format("dd/MM/yyyy")
                                                    .Value(@sinhvien.Ngay_vao_dang)
                                                    .HtmlAttributes(new { name="Ngay_vao_dang"})
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Ngày nhập học</label>
                                            <div class="controls">
                                                @(Html.Kendo().DateTimePicker()
                                                    .Name("Ngay_nhap_hoc")
                                                    .Format("dd/MM/yyyy")
                                                    .Value(@sinhvien.Ngay_nhap_hoc)
                                                    .HtmlAttributes(new { name="Ngay_nhap_hoc"})
                                                )
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="portlet box red">
                                    <div class="portlet-title">
                                        <h4>
                                            <i class="icon-reorder"></i>
                                            <span>Địa chỉ</span>
                                        </h4>
                                    </div>
                                    <div class="portlet-body form">

                                        @*<div class="control-group">
                                            <label class="control-label">Quốc gia</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.ID_quoc_tich" name="ID_quoc_tich" />
                                            </div>
                                        </div>*@
                                        <div class="control-group">
                                            <label class="control-label">Tỉnh/Thành phố</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_tinh_tt" name="ID_tinh_tt" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_tinh_tt")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name = "ID_tinh_tt" })
                                                    .Value(sinhvien.ID_tinh_tt.ToString())
                                                    .Events(e => {
                                                        e.DataBound("ID_tinh_tt_DataBound");
                                                    })
                                                    .BindTo(ViewBag.Tinh)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Quận/Huyện</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_huyen_tt" name="ID_huyen_tt" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_huyen_tt")
                                                    .OptionLabel("Chọn quận/huyện")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name = "ID_huyen_tt" })
                                                    .Value(sinhvien.ID_huyen_tt.ToString())
                                                    .CascadeFrom("ID_tinh_tt")
                                                    .DataSource(source => {
                                                        source.Read(read => {
                                                            read.Action("GetHuyen", "HoSo", new { Area="" }).Data("getTinhFilter");
                                                        }).ServerFiltering(true);
                                                    })
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Phường/Xã</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Xa_phuong_tt" name="Xa_phuong_tt" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Quốc gia</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.NoiO_hiennay" name="Noi_cap" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="tab_1_2">
                        <div class="row-fluid">
                            <div class="span6">
                                <div class="portlet box red">
                                    <div class="portlet-title">
                                        <h4>
                                            <i class="icon-reorder"></i>
                                            <span>Thông tin cha</span>
                                        </h4>
                                    </div>
                                    <div class="portlet-body form">

                                        <div class="control-group">
                                            <label class="control-label">Họ tên</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ho_ten_cha" name="Ho_ten_cha" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Dân tộc</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_dan_toc_cha" name="ID_dan_toc_cha" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_dan_toc_cha")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name="ID_dan_toc_cha" })
                                                    .Value(sinhvien.ID_dan_toc_cha.ToString())
                                                    .BindTo(ViewBag.DanToc)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Hoạt động xã hội chính trị</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Hoat_dong_XH_CT_cha" name="Hoat_dong_XH_CT_cha" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Quốc tịch</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_quoc_tich_cha" name="ID_quoc_tich_cha" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_quoc_tich_cha")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name="ID_quoc_tich_cha" })
                                                    .Value(sinhvien.ID_quoc_tich_cha.ToString())
                                                    .BindTo(ViewBag.QuocTich)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Hộ khẩu thường trú</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ho_khau_TT_cha" name="Ho_khau_TT_cha" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Năm sinh</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Namsinh_cha" name="Namsinh_cha" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Tôn giáo</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ton_giao_cha" name="Ton_giao_cha" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="portlet box red">
                                    <div class="portlet-title">
                                        <h4>
                                            <i class="icon-reorder"></i>
                                            <span>Thông tin mẹ</span>
                                        </h4>
                                    </div>
                                    <div class="portlet-body form">

                                        <div class="control-group">
                                            <label class="control-label">Họ tên</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ho_ten_me" name="Ho_ten_me" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Dân tộc</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_dan_toc_me" name="ID_dan_toc_me" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_dan_toc_me")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .HtmlAttributes(new { name="ID_dan_toc_me" })
                                                    .Value(sinhvien.ID_dan_toc_me.ToString())
                                                    .BindTo(ViewBag.DanToc)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Hoạt động xã hội chính trị</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Hoat_dong_XH_CT_me" name="Hoat_dong_XH_CT_me" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Quốc tịch</label>
                                            <div class="controls">
                                                @*<input type="text" value="@sinhvien.ID_quoc_tich_me" name="ID_quoc_tich_me" />*@
                                                @(Html.Kendo().DropDownList()
                                                    .Name("ID_quoc_tich_me")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .Value(sinhvien.ID_quoc_tich_me.ToString())
                                                    .BindTo(ViewBag.QuocTich)
                                                )
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Hộ khẩu thường trú</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ho_khau_TT_me" name="Ho_khau_TT_me" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Năm sinh</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Namsinh_me" name="Namsinh_me" />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">Tôn giáo</label>
                                            <div class="controls">
                                                <input type="text" value="@sinhvien.Ton_giao_me" name="Ton_giao_me" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                </div>

            </div>
            <div class="form-actions">
                <button class="btn red" type="submit"><i class="icon-ok"></i> Lưu</button>
                <button class="btn" type="button">Hủy</button>
            </div>
        </div>
    </div>
</form>
<script>
    $('#frmHoSo').submit(function () {
        $.ajax({
            url: '@Url.Action("Luu", "HoSo", new { Area=""})',
            type: 'post',
            dataType: 'json',
            data: $('#frmHoSo').serialize(),
            success: function (o) {
                alert(o.Message);
            }
        });
        return false;
    });
    //$('#btnCancel')
    $(document).ready(function () {
    })

    function getTinhFilter() {
        return {
            ID_tinh: $('#ID_tinh_tt').val()
        };
    }
    function ID_tinh_tt_DataBound() {

    }
</script>